//
//  LayerSwitcher.h
//  Jump
//
//  Created by Zach Wang on 14-5-22.
//
//

#ifndef __Jump__LayerSwitcher__
#define __Jump__LayerSwitcher__

#include "cocos2d.h"

USING_NS_CC;

class LayerSwitcher : public LayerMultiplex
{
public:
    void switchTo(int n);
    void switchToWithSectorTransition(int n);

    void switchToAndReleaseMe(int n);
    
    /**
     *  Custom animation of layer transition
     */
    std::function<void(Layer* oldLayer, Layer* newLayer)> setTransition;
    
    int getLayerIndex(){
        return _enabledLayer;
    }
    
    int getLayerCount(){
        return _layers.size();
    }
    
CC_CONSTRUCTOR_ACCESS:
    /**
     * @js ctor
     */
    LayerSwitcher();
    /**
     * @js NA
     * @lua NA
     */
    virtual ~LayerSwitcher();
    
    virtual bool init();
    
};

#endif /* defined(__Jump__LayerSwitcher__) */
